import request from "./request"

export const getAnnoApi = (obj:getAnno)=>{
    return request.post<any,axiosType<getAnno[]>>("/pro/anno/list",obj)
}

export const addAnno = (title:string,type:string,content:string,desc:string)=>{
    return request.post<any,axiosType<Addanno[]>>("/pro/anno/add",{
        title,
        content,
        type,
        desc
    })
}

export const getAnnoTypeApi = (label?:string)=>{
    return request.post<any,axiosType<annoTypeTypes[]>>("/pro/anno/type/list",{label})
}

export const addAnnoTypeApi = (label:string,value:number,color:string)=>{
    return request.post<any,axiosType<ADDAnnoType>>("/pro/anno/type/add",{
        label,
        value,
        color
    })
} 
export const uploadAnnoTypeApi = (label:string,color:string,_id:string)=>{
    return request.post<any,axiosType<uploadRoleTypes>>('/pro/anno/type/update',{
        label,
        color,
        _id
    })
}

export const deleAnnoTypeApi = (_id:string)=>{
    return request.post<any,axiosType<{acknowledged:boolean,deletedCount:number}>>("/pro//anno/type/delete",{_id})
}

export const uploadIMGApi = (file:File)=>{
    return request.post("/pro/uplodafile",{
        file
    })
}

export const deleAnno = (_id:string)=>{
    return request.post("/pro/anno/delete",{
        _id
    })
}
export const uploadAnno = (obj:uploadAnno)=>{
    return request.post("/pro/anno/update",obj)
}